{% extends 'base.html' %}

{% block title %}
    用户管理
{% endblock %}

{% block content %}
    <div class="container">
        <div style="margin-bottom: 10px">
            <a href="/d2/users/add/" class="btn btn-success">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新增人员
            </a>
        </div>

        <div class="bs-example" data-example-id="bordered-table">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>NAME</th>
                    <th>AGE</th>
                    <th>GENDER</th>
                    <th>ACCOUNT</th>
                    <th>DEPART</th>
                    <th>CREATEDATE</th>
                    <th>ACTION</th>
                </tr>
                </thead>
                <tbody>
                {% for user in users %}
                    <tr>
                        <td>{{ user.id }}</td>
                        <td>{{ user.name }}</td>
                        <td>{{ user.age }}</td>
                        <td>{{ user.get_gender_display }}</td>
                        <td>{{ user.account }}</td>
                        <td>{{ user.depart.title }}</td>
                        <td>{{ user.create_time|date:'Y-m-d H:i:s' }}</td>
                        <td>
                            <a href="/d2/users/{{ user.id }}/edit/" class="btn btn-primary btn-xs">编辑</a>
                            <a href="/d2/users/{{ user.id }}/delete/" class="btn btn-danger btn-xs">删除</a>
                        </td>
                    </tr>
                {% endfor %}

                </tbody>
            </table>
        </div>

    <ul class="pagination">
        {{ page_str }}
    </ul>

    </div>
{% endblock %}